package com.aiju.widgit;

import android.content.Context;
import android.util.AttributeSet;
import android.widget.ProgressBar;

import com.aiju.bean.AJUserLogin;
import com.aiju.widgit.config.UIConfig;
import com.aiju.widgit.style.ProgressBarStyle;

/**
 * @author: 佐为
 * @date: 2017-02-06 10:18
 * @version: V1.0
 * @Description: 描述
 */
public class AiJuProgressBar extends ProgressBar{
    
    public AiJuProgressBar(Context context) {
        super(context);
        initView(context);
    }

    public AiJuProgressBar(Context context, AttributeSet attrs) {
        super(context, attrs);
        initView(context);
    }

    private void initView(Context context) {
        UIConfig uiConfig = AJUserLogin.mUIConfig;
        if (uiConfig != null && uiConfig.getProgressBar() != null) {
            ProgressBarStyle progressBarStyle = uiConfig.getProgressBar();
            setIndeterminate(true);
            setIndeterminateDrawable(getResources().getDrawable(progressBarStyle.indeterminateDrawable));
        }
    }

}
